package cn.cvs.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.io.PrintWriter;

//公共的控制器
@Controller
public class Commonality {

    @RequestMapping("/Sexit")
    public String exit(HttpSession session) throws IOException {
        session.invalidate();//将session失效
        return "login";
    }

    @RequestMapping("/tologin")
    public String toLogin(){
        System.out.println("跳转页面");
        return "login";
    }

    @RequestMapping("/tiaozhuan")
    public String tiao(String name){
        System.out.println("跳转页面"+name);
        return name;
    }

}
